<template>
	<view class="app column">
		<view v-if="img" class="img">
			<image  :src="'https://maxh-1305457127.cos.ap-guangzhou.myqcloud.com/'+img" ></image>
		</view>
		<view v-html="detail">{{detail}}</view>
		<mix-loading v-if="isLoading" :type="2"></mix-loading>
	</view>
</template>

<script>
	import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
	import {getArticleDetail} from '../../common/js/api.js';
	export default {
		components: {
			jyfParser
		},
		data() {
			return {
					img:'',
					detail:'',
					title:''
			}
		},
		async onLoad(options) {
			const id = options.id;
			this.loadData(id);
		},
		methods: {
			async loadData(id){
				const obj ={id}
				const res = await getArticleDetail(obj)
				const { code,data} = res;
				if(code===200){
					uni.setNavigationBarTitle({
						title: data.title
					});
					this.img = data.img
					this.detail=data.detail;
					this.title=data.title;
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.app{
		padding: 10rpx 30rpx 30rpx;
		font-size: 30rpx;
		color: #333;
		line-height: 46rpx;
	}
	.img{
		margin: 0 10rpx 30rpx 10rpx;
	}
</style>
